#define quickread
#ifdef quickread
#include <cstdio> 
template <typename T>
inline void read(T& x)
{
    int c=getchar(), f=1; x=0;
    while(c<'0'||'9'<c) {if(c=='-') f=-1; c=getchar();}
    while('0'<=c&&c<='9') 
        x=(x<<3)+(x<<1)+c-'0', c=getchar();
    x*=f;
}
template <typename T>
inline void quickwrite(T x)
{
    if(x<0) putchar('-'), x*=-1;
    if(x>=10) quickwrite(x/10);
    putchar(x%10+'0');
}
#else 
#include <iostream>
#endif
#include <algorithm>
#include <cstring>
using namespace std;
#define DEBUG
const int N=60;
int n;
bool win=false;
char cards[N];

void init()
{
    read(n);
    scanf("%s",cards+1);
    win=false;
}   

bool judge(int x, int y) //x能否击败y(卡片编号转换为1~n表示)
{
    if(x==1) return y==n; //特例判断:卡片1仅当y==n时才能击败
    if(x==n) return y!=1;
    return x>y;
}

void solve()
{
    init();
    for(int i=1; i<=n; i++)
    {
        // printf("%c", cards[i]);
        if(cards[i]!='A') continue; //跳过不属于Alice的牌

        bool mustwin=true; //i是否为必胜牌

        for(int j=1; j<=n; j++)
        {
            if(cards[j]=='B'&&judge(j, i)) //Bob能否赢Alice
            {
                mustwin=false; break;
            }
        }

        if(mustwin) //Alice拥有必胜牌
        {
            win=true;
            break;
        }
    }
    if(win) puts("Alice");
    else puts("Bob");
} 

// #undef DEBUG
signed main()
{
    #ifdef DEBUG
        freopen("../in.txt", "r", stdin);
        freopen("../out.txt", "w", stdout);
    #endif
    #ifndef quickread
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    #endif

    int T=1; scanf("%d", &T);
    while(T--) 
    {
        solve();
    }
    return 0;
}
